package com.atguigu.dga230301.governance.demo;

import org.apache.commons.lang3.time.DateFormatUtils;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.util.Date;

@Component
public class ScheduledDemo {

    @Scheduled(cron = "0/5 * * * * *")
    public void test(){
        String time = DateFormatUtils.format(new Date(), "yyyy-MM-dd HH:mm:ss");
        System.out.println("当前时间为："+time);
    }
}
